/**
 * @file   1068.cpp
 * @author Shuang Hu <hsmath@ubuntu>
 * @date   Sat Apr  3 23:05:35 2021
 * 
 * @brief  Backtrack Algorithm to solve the problem
 * 
 * 
 */
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
    int nodenum;
    int money;
    vector<int> a;
    cin>>nodenum>>money;
    int data;
    for(int i=0;i<nodenum;i++){
	cin>>data;
	a.push_back(data);
    }
    sort(a.begin(),a.end());
    vector<int> Stack;//create a stack,store the indexes in the sequence
    int sum=0;//The sum of element in the stack
    bool ifsol;//There is a solution?
    Stack.push_back(0);
    sum=a[0];
    int pointer=1;
    if(sum>money){//Can't afford anything!
	ifsol=false;
    }
    else{
	while(Stack.size()){
	    if(sum+a[pointer]<money&&pointer<a.size()){//case1:can afford
		Stack.push_back(pointer);
		sum+=a[pointer];
		pointer++;
	    }else if(sum+a[pointer]==money){//case2:find a solution!
		Stack.push_back(pointer);
		ifsol=true;
		break;
	    }else{//case3:can't afford,Backtrack
		pointer=Stack[Stack.size()-1];//Find the rear
		sum=sum-a[pointer];
		Stack.pop_back();
		if(pointer==a.size()-1&&Stack.size()!=0){//Just the rear pointer
		    pointer=Stack[Stack.size()-1];
		    sum=sum-a[pointer];
		    Stack.pop_back();
		}
		pointer++;
		if(Stack.size()==0&&pointer<a.size()){//The first element is eliminated
		    Stack.push_back(pointer);
		    sum+=a[pointer];
		    pointer++;
		}
	    }
	}
    }
    if(ifsol==false){
	cout<<"No Solution"<<endl;
    }else{
	cout<<a[Stack[0]];
	for(int i=1;i<Stack.size();i++){
	    cout<<" "<<a[Stack[i]];
	}
	cout<<endl;
    }
}
